When you declare a variable within a function, the variable can only be accessed within that function. When you exit the function, the variable is destroyed. These variables are called local variables. You can have local variables with the same name in different functions, because each is recognized only by the function in which it is declared
#Title: JavaScript Variables
#Element: 157: Lifetime of Variables When you declare a variable ...
#Article: 79: JavaScript Variables